import { createSlice, type PayloadAction } from "@reduxjs/toolkit";

interface ChannelState {
    actServerId: string;
    actChannelId: string;
}

const initialState: ChannelState = {
    actServerId: '',
    actChannelId: '',
}

const channelStore = createSlice({
    name: "channel",
    initialState,
    reducers: {
        setServerId: (state, action: PayloadAction<string>) => {
            state.actServerId = action.payload;
        },
        setChannelId: (state, action: PayloadAction<string>) => {
            state.actChannelId = action.payload;
        },
    },
});


const channelReducer = channelStore.reducer

export const {setServerId, setChannelId} = channelStore.actions
export default channelReducer;